<?php

require_once ('paths.php');
require_once (CONFIG.'config.php');
require_once (INCLUDES.'authentication_nav.inc.php');  session_start(); 
require_once (INCLUDES.'url_variables.inc.php');
require_once (DB.'general.db.php');
require_once (LIB.'general.lib.php');
//include (INCLUDES.'version.inc.php');
include (INCLUDES.'headers.inc.php');
$today = date('Y-m-d');

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JIU Course Development Portal <?php echo $header_output; ?></title>
<?php if (($section == "view_course") && ($go != "default")) { ?>
<link href="http://courses.jonesinternational.edu/private/jiu/media/styles/style.css" type="text/css" rel="stylesheet" />
<link href="css/jiu-style.css" type="text/css" rel="stylesheet" />
<?php } else { ?>
<link rel="stylesheet" type="text/css" href="css/default.css" />
<?php } ?>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script type="text/javascript" src="fancybox/jquery.easing-1.3.pack.js"></script>
<script type="text/javascript" src="fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
<link rel="stylesheet" href="fancybox/jquery.fancybox.css?v=2.0.2" type="text/css" media="screen" />
<script type="text/javascript" src="fancybox/jquery.fancybox.pack.js?v=2.0.2"></script>
	<script type="text/javascript">
		$(document).ready(function() {

			$("#modal_window_link").fancybox({
				'width'				: '75%',
				'height'			: '75%',
				'fitToView'			: false,
				'scrolling'         : 'auto',
				'openEffect'		: 'elastic',
				'closeEffect'		: 'elastic',
				//'openEasing'     	: 'easeOutBack',
				//'closeEasing'   	: 'easeInBack',
				'openSpeed'         : 'normal',
				'closeSpeed'        : 'normal',
				'type'				: 'iframe',
				'helpers' 			: {	title : { type : 'inside' } },
				<?php if ($modal_window == "false") { ?>
				'afterClose': 		function() { parent.location.reload(true); }
				<?php } ?>
			});

		});
	</script>
<script type="text/javascript" src="js_includes/delete.js"></script>
<!-- <script type="text/javascript" src="js_includes/CalendarControl.js" ></script>
<script type="text/javascript" src="js_includes/jump_menu.js" ></script>
<script type="text/javascript" src="js_includes/menu.js"></script> -->
<script type="text/javascript" src="js_includes/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="js_includes/tinymce.init.js"></script>
<script type="text/javascript" src="js_includes/smoothscroll.js"></script>
<?php if (($action == "add") || ($action == "edit") || strstr($section, "step")) { ?>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.js"></script>
<?php include (INCLUDES.'form_check.inc.php'); 
}
?>
<script type="text/javascript">
function confirmation(url,field_name,field_value,messagetext) { 
  if (confirm(messagetext)==1){
  	location.href = eval('\"'+url+'&'+field_name+'='+field_value+'\"');
  }
}
</script>
</head>
<body>
<a name="top"></a>
<div id="container">
<?php if ($modal_window != "true") { ?>
<div id="navigation">
	<div id="navigation-inner"><?php include (SECTIONS.'nav.sec.php'); ?></div>
</div>
<?php } ?>
<div id="content">
	<div id="content-inner<?php if ($modal_window == "true") echo "-no-nav"; ?>">
    <?php //if ($modal_window != "true"){ ?>
    <div id="header">
		<div id="header-inner<?php if ($modal_window == "true") echo "-no-nav"; ?>"><h1><?php echo $header_output; ?></h1></div>
	</div>
    <?php //}
	if ($saved == "true") echo "<div class='saved'>Your place has been saved to the current page.</div>"; 
	if (isset($_SESSION['loginUsername'])) {
    if ((($action == "add") || ($action == "edit") || ($action == "review")) || (strstr($section,"step") || (($section == "view_proposal") && ($modal_window != "true") && ($go != "default")))) { ?>
    <?php if ($modal_window != "true") { ?><p><?php echo view_progress($cid,$mid,$section); ?></p><?php } ?>
	<form action="includes/process.inc.php?section=<?php echo $section; ?>&amp;action=<?php echo $action; ?>&amp;go=<?php echo $go; ?>&amp;dbTable=<?php echo $dbTable; ?>&amp;cid=<?php echo $cid; ?>&amp;mid=<?php echo $mid; ?>&amp;vid=<?php echo $vid; ?>&amp;id=<?php echo $id; ?>&amp;modal_window=<?php echo $modal_window; ?>" method="post" name="form1" id="form1">
	<?php }
    	if ($section == "dashboard")			include (SECTIONS.'dashboard.sec.php');
		if ($section == "view_proposal")		include (SECTIONS.'view_proposal.sec.php');
		if ($section == "view_module")			include (SECTIONS.'view_module.sec.php');
		if ($section == "view_course")			include (SECTIONS.'view_course.sec.php');
		if ($section == "view_comments")		include (SECTIONS.'display_comments.sec.php');
		if ($section == "cd") 					include (PROPOSAL.'proposal_course_description.sec.php');
		if ($section == "cpd")					include (PROPOSAL.'proposal_course_project_description.sec.php');
		if ($section == "proj_deliv") 			include (PROPOSAL.'proposal_project_deliverable.sec.php');
		if ($section == "clo") 					include (PROPOSAL.'proposal_course_learning_outcomes.sec.php');
		if ($section == "proposal_reveiw") 		include (PROPOSAL.'proposal_review.sec.php');
		if ($section == "proposal_titles") 		include (PROPOSAL.'proposal_titles.sec.php');
		if ($section == "proposal_materials") 	include (PROPOSAL.'proposal_materials.sec.php');
		if ($section == "proposal_email") 		include (PROPOSAL.'proposal_email.sec.php');
		if ($section == "module_home")			include (MODULES.'module_home.sec.php');
		if ($section == "module_assignment")	include (MODULES.'module_assignment.sec.php');
		if ($section == "module_exercise")		include (MODULES.'module_exercise.sec.php');
		if ($section == "module_theme")			include (MODULES.'module_theme.sec.php');
		if ($section == "module_readings")		include (MODULES.'module_readings.sec.php');
		if ($section == "course_home")			include (COURSE.'course_home.sec.php');
		if ($section == "course_project")		include (COURSE.'course_project.sec.php');
		if ($section == "course_syllabus")		include (COURSE.'course_syllabus.sec.php'); 
		if ($section == "course_resources")		include (COURSE.'course_resources.sec.php');
		if ($row_user['userLevel'] <= "2") {
			if ($section == "ce")				include (ADMIN.'ce.sec.php');
			if ($section == "id")				include (ADMIN.'id.sec.php');
			if ($section == "courses")			include (ADMIN.'courses.sec.php');
			if ($section == "comments")			include (ADMIN.'comments.sec.php');
		}
		include (INCLUDES.'last_update.inc.php'); 
	?>
<input type="hidden" name="url_last" value="<?php if ($modal_window == "true") echo CurrentPageURL(); else echo $_SERVER['HTTP_REFERER']; ?>" />  
</form>
    <?php 
	} 
	else { if ($section != "login") echo "<div class='error_msg'>Please log in to access this area.</div>"; }
	if ($section == "login")	include (SECTIONS.'login.sec.php');
	echo top_link($section,$modal_window); 
	?>
	</div>
</div>
</div>
<a name="bottom"></a>
<?php if ($modal_window != "true") { ?>
<div id="footer">
	<div id="footer-inner"><?php include (SECTIONS.'footer.sec.php'); ?></div>
</div>
<?php } ?>
</body>
</html>